package me.a_littlesquid.origin;

import me.a_littlesquid.origin.command.origin;
import me.a_littlesquid.origin.events.*;
import org.bukkit.ChatColor;
import org.bukkit.plugin.java.JavaPlugin;

public final class Origin extends JavaPlugin {
    private static Origin instance;
    public static Origin getInstance() {
        return instance;
    }
    @Override
    public void onEnable() {
        // Plugin startup logic
        instance=this;
        saveDefaultConfig();
        saveResource("data.yml",false);
        getCommand("origin").setExecutor(new origin());
        //命令
        getServer().getPluginManager().registerEvents(new blockplace(),this);
        getServer().getPluginManager().registerEvents(new peraluse(),this);
        getServer().getPluginManager().registerEvents(new bookuse(),this);
        getServer().getPluginManager().registerEvents(new milkuse(),this);
        getServer().getPluginManager().registerEvents(new catchjion(),this);
        getServer().getPluginManager().registerEvents(new catchrespawn(),this);
        this.getLogger().info(ChatColor.AQUA+"---------------------");
        this.getLogger().info("插件名称："+ ChatColor.GOLD+"Origin");
        this.getLogger().info("作者："+ChatColor.GOLD+"a——littlesquid");
        this.getLogger().info(ChatColor.RED+"私用插件，请勿转发倒卖！");
        this.getLogger().info(ChatColor.GREEN+"成功加载插件");
        this.getLogger().info(ChatColor.GREEN+"祝您游玩愉快");
        this.getLogger().info(ChatColor.AQUA+"---------------------");
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
        this.getLogger().info(ChatColor.RED+"卸载成功");
    }
}
